package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.CrmOrderDetailsMapper;
import com.ruoyi.crm.domain.CrmOrderDetails;
import com.ruoyi.crm.service.ICrmOrderDetailsService;

/**
 * 订单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-10-31
 */
@Service
public class CrmOrderDetailsServiceImpl implements ICrmOrderDetailsService 
{
    @Autowired
    private CrmOrderDetailsMapper crmOrderDetailsMapper;

    /**
     * 查询订单明细
     * 
     * @param orderDetailUuid 订单明细主键
     * @return 订单明细
     */
    @Override
    public CrmOrderDetails selectCrmOrderDetailsByOrderDetailUuid(String orderDetailUuid)
    {
        return crmOrderDetailsMapper.selectCrmOrderDetailsByOrderDetailUuid(orderDetailUuid);
    }

    /**
     * 查询订单明细列表
     * 
     * @param crmOrderDetails 订单明细
     * @return 订单明细
     */
    @Override
    public List<CrmOrderDetails> selectCrmOrderDetailsList(CrmOrderDetails crmOrderDetails)
    {
        return crmOrderDetailsMapper.selectCrmOrderDetailsList(crmOrderDetails);
    }

    /**
     * 新增订单明细
     * 
     * @param crmOrderDetails 订单明细
     * @return 结果
     */
    @Override
    public int insertCrmOrderDetails(CrmOrderDetails crmOrderDetails)
    {
        crmOrderDetails.setCreateTime(DateUtils.getNowDate());
        return crmOrderDetailsMapper.insertCrmOrderDetails(crmOrderDetails);
    }

    /**
     * 修改订单明细
     * 
     * @param crmOrderDetails 订单明细
     * @return 结果
     */
    @Override
    public int updateCrmOrderDetails(CrmOrderDetails crmOrderDetails)
    {
        crmOrderDetails.setUpdateTime(DateUtils.getNowDate());
        return crmOrderDetailsMapper.updateCrmOrderDetails(crmOrderDetails);
    }

    /**
     * 批量删除订单明细
     * 
     * @param orderDetailUuids 需要删除的订单明细主键
     * @return 结果
     */
    @Override
    public int deleteCrmOrderDetailsByOrderDetailUuids(String[] orderDetailUuids)
    {
        return crmOrderDetailsMapper.deleteCrmOrderDetailsByOrderDetailUuids(orderDetailUuids);
    }

    /**
     * 删除订单明细信息
     * 
     * @param orderDetailUuid 订单明细主键
     * @return 结果
     */
    @Override
    public int deleteCrmOrderDetailsByOrderDetailUuid(String orderDetailUuid)
    {
        return crmOrderDetailsMapper.deleteCrmOrderDetailsByOrderDetailUuid(orderDetailUuid);
    }
}
